<template>
    <div class="myPlaylist">
        <div class="myPlaylist_header">
            <div class="header-title">
                <slot name="title"></slot>
            </div>
            <div class="header-add">
                <slot name="add"></slot>
            </div>
            <div class="header-more">
                <slot name="more"></slot>
            </div>
        </div>
        <div class="myPlaylist_content">
            <slot name="content">
                <div class="content_rest">
                    <slot v-if="!isLoading">暂时还没有歌单</slot>
                    <slot v-if="isLoading">
                        <div class="loadingAnimate">
                        <ul class="strip-loading">
                            <li style="--line-index: 1;"></li>
                            <li style="--line-index: 2;"></li>
                            <li style="--line-index: 3;"></li>
                            <li style="--line-index: 4;"></li>
                            <li style="--line-index: 5;"></li>
                            <li style="--line-index: 6;"></li>
                        </ul>
                        <span class="loadingText">正在加载……</span>
                        </div>
                    </slot>
                </div>
            </slot>
        </div>
    </div>
</template>
<style>
    .loadingAnimate{
        position: absolute;
        left: 50%;
        top: 25%;
        transform: translate(-50%,-50%);
        display: flex;
        align-items: center;
    }
    .loadingText{
        display: inline;
        font-size: .4rem;
        color: gray;
    }
    .strip-loading {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 200px;
        transform: scale(.6);
    }

    .strip-loading li {
        --time: calc((var(--line-index) - 1) * 200ms);
        border-radius: 3px;
        width: 6px;
        height: 30px;
        background-color: #FE3A3B;
        animation: beat .7s ease-in-out var(--time) infinite;
        list-style-type: none;
    }

    li + li {
        margin-left: 5px;
    }
    @keyframes beat {
        0%,100% {
            transform: scaleY(1);
        }
        50% {
            transform: scaleY(.5);
        }
    }
</style>
<script>
    export default {
        props:{
            isLoading:{
                type:Boolean,
                default:false
            }
        }
    }
</script>